#include <algorithm>
#include <iostream>
#include <stack>
using namespace std;

const int kMaxN = 2e5 + 10;
const int kMaxM = 2e5 + 10;
const int kMaxH = 1e9;

int a[kMaxN], b[kMaxN];
int x[kMaxM];
int need_cut[kMaxN], l[kMaxN];

bool cmp(int t1, int t2) {
  return b[t1] > b[t2] || (b[t1] == b[t2] && t1 > t2);
}

bool Solve(int n, int m) {
  stack<int> s;

  for (int i = 1; i <= n; i++) {
    if (b[i] > a[i]) {
      return false;
    }
  }

  sort(x, x + m);
  reverse(x, x + m);
  x[m] = 0;

  int tot = 0;
  b[0] = kMaxH + 1;
  s.push(0);
  for (int i = 1; i <= n; i++) {
    for (; b[s.top()] <= b[i]; s.pop());
    l[i] = s.top();
    s.push(i);
    if (a[i] != b[i]) {
      need_cut[tot++] = i;
    }
  }
  sort(need_cut, need_cut + tot, cmp);

  int last_b = b[need_cut[0]] + 1, last_l = 0;

  for (int i = 0, j = 0; i < tot; i++) {
    for (; j < m && x[j] > b[need_cut[i]]; j++);
    if (last_b > b[need_cut[i]] || (last_b == b[need_cut[i]] && last_l > need_cut[i])) {
      last_b = b[need_cut[i]];
      last_l = l[need_cut[i]];
      if (x[j] == last_b) {
        j++;
      } else {
        return false;
      }
    }
  }
  return true;
}

int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int T;
  for (cin >> T; T; T--) {
    int n, m;

    cin >> n;
    for (int i = 1; i <= n; i++) {
      cin >> a[i];
    }
    for (int i = 1; i <= n; i++) {
      cin >> b[i];
    }

    cin >> m;
    for (int i = 0; i < m; i++) {
      cin >> x[i];
    }

    cout << (Solve(n, m) ? "YES\n" : "NO\n");
  }
  return 0;
}